using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.IO;

namespace Impact.Model.Objects
{

    /// <remarks/>
    [Serializable()]
    [XmlType( "rss", AnonymousType = true )]
    [XmlRoot( "rss", IsNullable = false )]
    public partial class RssFeed
    {

        /// <summary>
        /// default constructor
        /// </summary>
        public RssFeed()
        {
            channelField = new List<RssChannel>();
        }

        private List<RssChannel> channelField;

        private string versionField;

        /// <remarks/>
        [XmlElement( "channel", Form = XmlSchemaForm.Unqualified )]
        public List<RssChannel> channel
        {
            get
            {
                return this.channelField;
            }
        }

        /// <remarks/>
        [XmlAttribute()]
        public string version
        {
            get
            {
                return this.versionField;
            }
            set
            {
                this.versionField = value;
            }
        }

        /// <summary>
        /// Serializes this RSS Feed to the given output stream
        /// </summary>
        /// <param name="outputStream"></param>
        public void Serialize(Stream outputStream)
        {
            XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
            namespaces.Add( "pingback", "http://madskills.com/public/xml/rss/module/pingback/" );
            namespaces.Add( "slash", "http://purl.org/rss/1.0/modules/slash/" );

            XmlSerializer serializer = new XmlSerializer( this.GetType() );
            serializer.Serialize( outputStream, this, namespaces );
        }

    }

    /// <remarks/>
    [Serializable()]
    [XmlType( AnonymousType = true )]
    public partial class RssChannel
    {

        /// <summary>
        /// default constructor
        /// </summary>
        public RssChannel()
        {
            imageField = new List<RssChannelImage>();
            itemField = new List<RssItem>();
        }

        private string titleField;

        private string descriptionField;

        private string linkField;

        private string generatorField;

        private string languageField;

        private List<RssChannelImage> imageField;

        private List<RssItem> itemField;

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string title
        {
            get
            {
                return this.titleField;
            }
            set
            {
                this.titleField = value;
            }
        }

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string description
        {
            get
            {
                return this.descriptionField;
            }
            set
            {
                this.descriptionField = value;
            }
        }

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string link
        {
            get
            {
                return this.linkField;
            }
            set
            {
                this.linkField = value;
            }
        }

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string generator
        {
            get
            {
                return this.generatorField;
            }
            set
            {
                this.generatorField = value;
            }
        }

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string language
        {
            get
            {
                return this.languageField;
            }
            set
            {
                this.languageField = value;
            }
        }

        /// <remarks/>
        [XmlElement( "image", Form = XmlSchemaForm.Unqualified )]
        public List<RssChannelImage> image
        {
            get
            {
                return this.imageField;
            }
        }

        /// <remarks/>
        [XmlElement( "item", Form = XmlSchemaForm.Unqualified )]
        public List<RssItem> item
        {
            get
            {
                return this.itemField;
            }
        }
    }

    /// <remarks/>
    [Serializable()]
    [XmlType( AnonymousType = true )]
    public partial class RssChannelImage
    {

        private string linkField;

        private string urlField;

        private string titleField;

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string link
        {
            get
            {
                return this.linkField;
            }
            set
            {
                this.linkField = value;
            }
        }

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string url
        {
            get
            {
                return this.urlField;
            }
            set
            {
                this.urlField = value;
            }
        }

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string title
        {
            get
            {
                return this.titleField;
            }
            set
            {
                this.titleField = value;
            }
        }
    }

    /// <remarks/>
    [Serializable()]
    [XmlType( AnonymousType = true )]
    public partial class RssItem
    {

        /// <summary>
        /// default constructor
        /// </summary>
        public RssItem()
        {
            categoryField = new List<string>();
            guidField = new RssItemGuid();
        }


        private string titleField;

        private string descriptionField;

        private string linkField;

        private string commentsField;

        private string pubDateField;

        private RssItemGuid guidField;

        private List<string> categoryField;

        private string serverField;

        private string targetField;

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string title
        {
            get
            {
                return this.titleField;
            }
            set
            {
                this.titleField = value;
            }
        }

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string description
        {
            get
            {
                return this.descriptionField;
            }
            set
            {
                this.descriptionField = value;
            }
        }

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string link
        {
            get
            {
                return this.linkField;
            }
            set
            {
                this.linkField = value;
            }
        }

        /// <remarks/>
        [XmlElement( "comments", Form = XmlSchemaForm.Unqualified )]
        public string commentsLink
        {
            get
            {
                return this.commentsField;
            }
            set
            {
                this.commentsField = value;
            }
        }

        /// <remarks/>
        [XmlElement( Form = XmlSchemaForm.Unqualified )]
        public string pubDate
        {
            get
            {
                return this.pubDateField;
            }
            set
            {
                this.pubDateField = value;
            }
        }

        /// <remarks/>
        [XmlElement( "guid", Form = XmlSchemaForm.Unqualified, IsNullable = true )]
        public RssItemGuid guid
        {
            get
            {
                return this.guidField;
            }
            set
            {
                this.guidField = value;
            }
        }

        /// <remarks/>
        [XmlElement( "category", Form = XmlSchemaForm.Unqualified, IsNullable = true )]
        public List<string> category
        {
            get
            {
                return this.categoryField;
            }
        }

        /// <summary>
        /// URL of server that handles pingback requests
        /// </summary>
        [XmlElement( "server", Namespace = "http://madskills.com/public/xml/rss/module/pingback/" )]
        public string pingbackServer
        {
            get { return this.serverField; }
            set { this.serverField = value; }
        }

        /// <summary>
        /// URL of the article that is the target of the pingback
        /// </summary>
        [XmlElement( "target", Namespace = "http://madskills.com/public/xml/rss/module/pingback/" )]
        public string pingbackTarget
        {
            get { return this.targetField; }
            set { this.targetField = value; }
        }

        private string slashCommentsField;

        /// <summary>
        /// number of comments in this item
        /// </summary>
        [XmlElement( "comments", Namespace = "http://purl.org/rss/1.0/modules/slash/" )]
        public string slashComments
        {
            get { return slashCommentsField; }
            set { slashCommentsField = value; }
        }




    }

    /// <remarks/>
    [Serializable()]
    [XmlType( AnonymousType = true )]
    public partial class RssItemGuid
    {

        private string isPermaLinkField;

        private string valueField;

        /// <remarks/>
        [XmlAttribute()]
        public string isPermaLink
        {
            get
            {
                return this.isPermaLinkField;
            }
            set
            {
                this.isPermaLinkField = value;
            }
        }

        /// <remarks/>
        [XmlText()]
        public string Value
        {
            get
            {
                return this.valueField;
            }
            set
            {
                this.valueField = value;
            }
        }
    }


    /*
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCode( "xsd", "2.0.50727.42" )]
    [System.Serializable()]
    [System.Diagnostics.DebuggerStepThrough()]
    [System.ComponentModel.DesignerCategory( "code" )]
    [XmlType( AnonymousType = true )]
    public partial class rssChannelItemCategory
    {

        private string valueField;

        /// <remarks/>
        [XmlText()]
        public string Value
        {
            get
            {
                return this.valueField;
            }
            set
            {
                this.valueField = value;
            }
        }
    }
    */

}
